home *** CD-ROM | disk | FTP | other *** search
- #include <conio.h>
- #include <stdio.h>
- #include <dos.h>
- #include <math.h>
-
- int valloc( unsigned long size );
- long far *SIN, *COS;
-
- void InitSinCos(void)
- // Setup Sine and cosine tables.
- { float A;
- int a;
-
- a=valloc(2048);
- SIN=(long far *)MK_FP( a, 0 );
- a=valloc(2048);
- COS=(long far *)MK_FP( a, 0 );
-
- for ( a=0; a<256; a++ )
- {
- A=(float)a;
- A=A/256;
- A=A*2*M_PI;
- SIN[a]=(long)(sin(A)*0x10000L);
- COS[a]=(long)(cos(A)*0x10000L);
- };
- }
-
-